package com.whmskj.xjlhsc.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.whmskj.xjlhbc.core.Page;
import com.whmskj.xjlhsc.entity.Managementofxt03;
import com.whmskj.xjlhsc.service.Managementofxt03Service;
import com.whmskj.xjlhsc.mapper.Managementofxt03Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author i
* @description 针对表【managementOfXt03】的数据库操作Service实现
* @createDate 2025-09-12 16:22:15
*/
@Service
public class Managementofxt03ServiceImpl extends ServiceImpl<Managementofxt03Mapper, Managementofxt03>
    implements Managementofxt03Service{
    @Autowired
    private Managementofxt03Mapper managementofxt03Mapper;
    /**
     * 获取工种列表
     * @return
     */
    @Override
    public List<Managementofxt03> getTypeOfWorkList(Integer isProduct) {
        Page.startPage();
        LambdaQueryWrapper<Managementofxt03> managementofxt03LambdaQueryWrapper=null;
        if (isProduct==1) {
            managementofxt03LambdaQueryWrapper = new LambdaQueryWrapper<>();
            managementofxt03LambdaQueryWrapper.eq(Managementofxt03::getProductionwage, "是");
        }
        return list(managementofxt03LambdaQueryWrapper);
    }

    @Override
    public boolean canAccessScanPanel(String typeOfWorkName) {
        LambdaQueryWrapper<Managementofxt03> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Managementofxt03::getNameofjob, typeOfWorkName)
                .eq(Managementofxt03::getProductionwage, "是")
                .in(Managementofxt03::getAutomaticcollectionmanualentry, "自动采集", "自动采集/手动录入", "自动采集手动录入", "自动");
        return count(wrapper) > 0;
    }
}




